package leetcode.每日一题.模拟;

import org.junit.Test;

/**
 * @author ：zsy
 * @date ：Created 2023/1/8 9:26 PM
 * @description：
 */
public class 统计包含给定前缀的字符串 {
    @Test
    public void test() {

    }

    class Solution {
        public int prefixCount(String[] words, String pref) {
            int ans = 0;
            for (String word : words) {
                if (word.length() < pref.length()) continue;
                if (word.startsWith(pref)) {
                    ans++;
                }
            }
            return ans;
        }
    }
}
